﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OleDb;
using Catch.ISQLServerDAL;
using System.Configuration;

namespace Catch.SQLServerDAL
{
    public class ACCESSHelper : ISQLManager
    {
        /// <summary>
        /// 配置文件
        /// </summary>
        private readonly string conn = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;
        #region ISQLManager 成员

        public DataSet GetDateSet(string sqlString)
        {
            OleDbConnection aConnection = new OleDbConnection(conn);

            //创建command对象并保存sql查询语句
            OleDbCommand aCommand = new OleDbCommand(sqlString, aConnection);
            OleDbDataAdapter adapt = new OleDbDataAdapter(aCommand);
            DataSet ds = new DataSet();

            adapt.Fill(ds, "ds");
            return ds;
        }

        #endregion
    }
}
